this, SLOT(httpRequestFinished(QNetworkReply*)));
QNetworkRequest request = QNetworkRequest(upgradeUrl_);
+
+ // In Qt 5.6 and later, it can reissue with a redirect. With this in
+ // place, we don't see the 301 redirect, but the server has to issue
+ // one for the thousands of older clients out there.
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
request.setRawHeader("Accept-Encoding","identity");
}
// GPSBabel version numbers throughout the code mostly predate QVersionNumber
-// and are stored as strings. They may be of the form "1.6.0-beta20200413"
+// and are stored as strings. They may be of the form "1.6.0-beta20200413"
// which, if sorted as a string, will be after "1.6.0" which is bad. Use
-// this function to sort that out. (See what I did there? Bwaaaahah!)
-bool UpgradeCheck::suggestUpgrade(const QString& from, const QString& to)
+// this function to sort that out. (See what I did there? Bwaaaahah!)
+bool UpgradeCheck::suggestUpgrade(const QString& from, const QString& to)
{
int fromIndex = 0;
int toIndex = 0;
if (fromVersion < toVersion) {
return true;
}
- // Just look for the presence of stuff (not even the contents) of the
+ // Just look for the presence of stuff (not even the contents) of the
// string. Shorter string (no "-betaXXX" wins)
if (fromVersion == toVersion) {
if (from.length() - fromIndex > to.length() - toIndex) {
}
return false;
}
-// Some day when we have Gunit or equiv, add unit tests for:
+// Some day when we have Gunit or equiv, add unit tests for:
//suggestUpgrade(updateVersion, currentVersion_);
//suggestUpgrade("1.6.0-beta20190413", "1.6.0");
//suggestUpgrade("1.6.0", "1.6.0-beta20190413");